//
//  SEGGetMyAddressManager.m
//  Commom
//
//  Created by Clavis on 2019/4/17.
//  Copyright © 2019 山刘. All rights reserved.
//

#import "SEGGetMyAddressManager.h"

#if __has_include(<Commom/SEGHTTPBusinessManager.h>)
#import <Commom/SEGHTTPBusinessManager.h>
#else
#import "SEGHTTPBusinessManager.h"
#endif

static id _getMyAddressManager;
static dispatch_once_t onceToken;

@implementation SEGGetMyAddressManager

+(instancetype)sharedManager{
    dispatch_once(&onceToken, ^{
        _getMyAddressManager = [[self alloc] init];
    });
    return _getMyAddressManager;
}

+(void)destroyResource{
    onceToken = 0;
    _getMyAddressManager = nil;
}


/**
 请求我的地址

 @param parameters 参数
 @param finished 回调
 */
-(void)requestMyAddressWithParameters:(NSDictionary*)parameters finished:(void(^)(BOOL isSuccessed,id result,NSString* codeType,NSString* errorMessage))finished {
    
    NSString *urlString = [SEGServerManager serverUrlJoint:kClientRootURL,@"/",kUhomecp_sso,@"/v1/userApp/info/getMyAddress",nil];
    [SEGHTTPBusinessManager seg_requestWithMethod:POST URLString:urlString parameters:nil finished:^(BOOL isSuccessed, id result, NSString *codeType, NSString *errorMessage) {
        finished(isSuccessed, result, codeType, errorMessage);
    }];
}
@end
